<?php

class Default_Model_Users extends Zend_Db_Table_Abstract
{
    protected $_name = 'users';
    public function getUserByUsername($username)
    {
    	$query = $this->select();
        $query->from($this->_name,array('userId', 'username', 'password', 'status'));
        $query->where('username = ?', $username);
        return $this->fetchRow($query);
    }
    public function getUserById($id)
    {
    	$query = $this->select();
        $query->from($this->_name,array('userId', 'username', 'password', 'status'));
        $query->where('userId = ?', $id);
        return $this->fetchRow($query);
    }
    public function updatePass ($userId, $password)
    {
        $data['password'] = $password;
        $this->update($data, "userId = $userId");
    }
}

